/*
 * Copyright (c) 2024 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef __UAPI_BOOTINFO_H__
#define __UAPI_BOOTINFO_H__
#include "caps/capability.h"
#include "stdlib/stdint.h"

#define MAX_RAM_INFO    16
#define FLAG_RAM_USER   0x0UL
#define FLAG_RAM_KERNEL 0x1UL
#define FLAG_RAM_KDEV   0x2UL

typedef struct region {
    uint64_t     pbase;
    uint64_t     vbase;
    uint64_t     size;
    unsigned int directmap;
} region_t;

static inline void region_init(region_t *r, uint64_t pbase, uint64_t vbase, uint64_t size)
{
    r->pbase = pbase;
    r->vbase = vbase;
    r->size  = size;
}
typedef struct boot_info {
    void        *ipcbuffer;
    unsigned int ipcbufferlen;

    void        *stack;
    unsigned int stacklen;

    unsigned int  guardlen;
    unsigned int  guard;
    unsigned int  radix;
    unsigned int  freeindex;
    capability_t *cspace;

    const unsigned int *caps_size;

    struct {
        unsigned long long vbase;
        int                size;
        int                flag;
    } initsect[MAX_RAM_INFO];

} bootinfo_t;
#endif
